import React,{lazy,Suspense} from 'react';
import {Redirect, Route, Switch} from "react-router-dom";
import Loading from "../../components/Loading/Loading";
import MyTabBar from "../../components/TabBar/TabBar";
const ChatList = lazy(() => import('./chatList/ChatList'))
const Contacts = lazy(() => import('./contacts/Contacts'))
const Mine = lazy(() => import('./Mine/Mine'))
function InApp() {
    return (
        <div className="App">
            <Suspense fallback={(<Loading />)}>
                <Switch>
                    <Route path='/in/chat' component={ChatList}/>
                    <Route path='/in/contacts' component={Contacts}/>
                    <Route path='/in/mine' component={Mine}/>
                    <Redirect to='/in/chat'/>
                </Switch>
            </Suspense>
            <MyTabBar />
        </div>
    );
}

export default InApp;
